package cn.rxmind.dlog.common;

import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.Map;

/**
 *
 * @description 这里定义最基础的日志字段
 *
 * @author renxin
 * @email renxinzhiliangzhi@163.com
 * @date 2020/7/10 1:17 下午
 */
@Getter
@Setter
public class DLogData implements Serializable{

    private long startTime;

    private long endTime;

    private Object[] args;

    private Object result;

    private Map<String,Object> param;

    public Object getValue(String key){
        if("startTime".equals(key)){
            return startTime;
        }
        if("endTime".equals(key)){
            return endTime;
        }
        if("args".equals(key)){
            return args;
        }
        if("result".equals(key)){
            return result;
        }

        return param.get(key);
    }

}
